Conversation
doc/commands/build_command.md
Outdated
| Uses the semaphore feature in Cabal/GHC to build multiple modules from the same | ||
| package in parallel. (see GHC's documentation on `-jsem`) |
There was a problem hiding this comment.
probably better if I can refer to cabal's docs for the --semaphore flag, but I couldn't find any (aside from the extremely short description in --help). There are some docs for cabal-install's --semaphore but that's not quite the same thing
d66961a to
26128a1
Compare
|
@horriblename, thanks! Don't worry about the CI for Linux with I am wondering about the user experience if they accidently specify EDIT: I had not paid attention to I have opened an issue at Cabal's repository: |
|
@horriblename, other than handling the Stack user experience when I've pushed a commit to better conform the online and in-app documentation to other documentation. EDIT: I have also pushed a commit to ignore the flag with a warning when it is unsupported. EDIT2: I have also pushed a commit to update a relevant unit test. |
|
Tested on Windows 11 by building Stack itself: reduced from 83 s to 50 s (~40% less time). |
I suppose there's nothing I need to do anymore? (thanks!) |
|
@horriblename, many thanks. I'll likely merge this once the current CI passes. |
Also moves `--[no-]semaphore` higher up the list of `stack build --help` options.
|
@horriblename, some disappointing news. I have learned that GHC's semaphore feature has major problems on Linux, because musl and non-musl semaphores are incompatible:
In the light of that, I am going to add something to Stack's documentation and label the feature as experimental. |
implements #6131
Please include the following checklist in your pull request:
Please also shortly describe how you tested your change. Bonus points for added tests!
(I'm not sure what kind of test I can add for this?)
a quick benchmark matches claims in https://well-typed.com/blog/2023/08/reducing-haskell-parallel-build-times/ regarding compiling
lens(112s vs 140s, ~20% improvement).rm -r $(stack exec -- stack path --snapshot-pkg-db)was deleted before each runSome notes about the implementation
semaphore-compat, which is also used by cabal